﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MobileMasterPage.master"
    AutoEventWireup="true" CodeFile="WishingWall.aspx.cs" Inherits="M_WishingWall" EnableViewState="false" %>
<%@ MasterType VirtualPath="~/MasterPage/MobileMasterPage.master" %>
<asp:Content ID="Content4" ContentPlaceHolderID="JqMobilePlaceHolder1" Runat="Server">
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/css/jquery.mobile-1.4.5.min.css") %>" />      
    <script src='<%=ResolveUrl("~/Scripts/jquery.mobile-1.4.5.min.js")%>' type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="headPlaceHolder" runat="Server">
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/css/M_WishingWall.css") %>" />
    <script type="text/javascript">
        var currpage = 1;
        jQuery(document).ready(function () {
            loadInitList(); more_body
            jQuery("#more_body").click(function () {
                loadMoreList();
            });
        });
        var loadInitList = function () {
            showLoader();
            var url='<%=ResolveUrl("~/Ajax/M_Get_WishNote_List.aspx")%>' + "?pagesize=20&currpage=1&r=" + Math.random();
            jQuery("#con_body").load(url, function () {
                hideLoader();
            });
        }
        var isMoreLoading = 0;//开关,是否加载中
        var loadMoreList = function () {
            if (isMoreLoading == 1) {
                return;
            }
            else {
                isMoreLoading = 1;
            }
            currpage++;
            jQuery("#more_body").attr("disabled", "disabled");
            jQuery("#more_text").text("加载中...")
            var url = '<%=ResolveUrl("~/Ajax/M_Get_WishNote_List.aspx")%>' + "?pagesize=20&currpage=" + currpage + "&r=" + Math.random();
            jQuery.get(url, function (data) {
                jQuery("#con_body").append(data);
                jQuery("#more_text").text("更多...");
                isMoreLoading = 0;
            });
        }
        var hitPraise = function (obj, ni) {
            var hitb = obj;
            $(hitb).removeAttr("onclick");
            jQuery.get('<%=ResolveUrl("~/Ajax/M_Hit_Praise.ashx")%>', { i: ni }, function (resoult) {
                if (resoult != "-1") {
                    //                    alert($(hitb).find(".hit_count").text());
                    $(hitb).find(".hit_count").html(resoult);
                }
            });
        }
        //显示加载器
        function showLoader() {
            //显示加载器.for jQuery Mobile 1.2.0
            $.mobile.loading('show', {
                text: '加载中...', //加载器中显示的文字
                textVisible: true, //是否显示文字
                theme: 'b',        //加载器主题样式a-e
                textonly: false,   //是否只显示文字
                html: ""           //要显示的html内容，如图片等
            });
        }
        //隐藏加载器.for jQuery Mobile 1.2.0
        function hideLoader() {
            //隐藏加载器
            $.mobile.loading('hide');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="headerPlaceHolder" runat="Server">

    <a id="send_wish_btn" data-ajax="false" href="<%=ResolveUrl("~/m/NewWishNote.aspx")%>" > <img src='<%=ResolveUrl("~/Images/m_wish_write.png")%>' alt=""/>我来祝福</a>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentPlaceHolder" runat="Server">
    <div id="con_body">
    </div>
    <div id="more_body">
        <span id="more_text">更多...</span>
    </div>
</asp:Content>
